package me.shiqiang.im.server;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

/**
 * Created by maliangxue on 2018/1/9.
 */
@Service
@CacheConfig(cacheNames = "token")
public class AuthService {

    @Autowired
    AuthClient authClient;


    @Cacheable(key = "#userId")
    public String getToken(Long userId,String deviceId){
        return authClient.getToken(userId,deviceId);
    }
}
